<?php
class ui_friend_action_edit extends ui {
	/**
	 * 修改好友昵称和分组
	 *
	 * @param Object $S
	 * @param Array $param = array (
	 * 			'id'		=>		// friend表中的主键id
	 * 			'nickname'	=>		// 修改后的昵称	Magic quote, encodeURIComponent
	 * )
	 */
	public function __construct($S, $param) {
		parent::__construct();
		
		$param['nickname'] = stripslashes(strip_tags(trim($param['nickname'])));
		
		$data_friend = new data_friend();
		$data = $data_friend->edit($this->uid, $param['id'], $param['nickname']);
		
		if ($data) {
			$S->assign('data', 'true');
		} else {
			$S->assign('data', 'false');
		}
	}
}
?>